FROM markadams/chromium-xvfb-py2
MAINTAINER george

ADD sources.list /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y git
RUN apt-get install -y python-dev python-gevent python-mysqldb build-essential


run apt-get install locales

run echo "zh_CN.UTF-8 UTF-8" > /etc/locale.gen
run locale-gen 

env LC_CTYPE zh_CN.UTF-8
env LC_MESSAGES zh_CN.UTF-8
env LC_TIME zh_CN.UTF-8

RUN apt-get install -y xfonts-intl-chinese
RUN apt-get install -y ttf-wqy-*
RUN apt-get install libssl-dev libffi-dev -y


ADD requirements.txt /home/requirements.txt
ADD pip.conf /home/.pip/pip.conf
ADD pip.conf /root/.pip/pip.conf
RUN pip install -U pip
RUN pip install cryptography
RUN pip install -r /home/requirements.txt 

ADD phantomjs-1.9.8-linux-x86_64.tar.bz2 /home/phantomjs-1.9.8-linux-x86_64.tar.bz2
RUN mv /home/phantomjs-1.9.8-linux-x86_64.tar.bz2/phantomjs-1.9.8-linux-x86_64 /usr/local/share
ADD PhantomJS.sh /home/PhantomJS.sh
RUN ln -sf /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/bin

RUN pip install timeout_decorator
ENV TZ Asia/Taipei
RUN apt-get install -y python-pil

